package com.attendance.www.hr.service.impl;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.apache.commons.lang.time.DateUtils;
import org.springframework.stereotype.Service;

import com.attendance.www.hr.beans.CorporationBean;
import com.attendance.www.hr.beans.ReportAttendanceBean;
import com.attendance.www.hr.beans.ReportAttendanceParam;
import com.attendance.www.hr.dao.mapper.CorporationExtMapper;
import com.attendance.www.hr.dao.mapper.CorporationMapper;
import com.attendance.www.hr.dao.mapper.DepartmentMapper;
import com.attendance.www.hr.dao.mapper.EmployeeCorporationMapper;
import com.attendance.www.hr.dao.mapper.EmployeeDepartmentMapper;
import com.attendance.www.hr.dao.mapper.EmployeeExtMapper;
import com.attendance.www.hr.dao.mapper.EmployeeMapper;
import com.attendance.www.hr.dao.mapper.EmployeeRoleExtMapper;
import com.attendance.www.hr.dao.mapper.EmployeeRoleMapper;
import com.attendance.www.hr.dao.mapper.PrivilegeGroupMapper;
import com.attendance.www.hr.dao.mapper.ReportAttendanceExtMapper;
import com.attendance.www.hr.dao.mapper.RoleMapper;
import com.attendance.www.hr.dao.mapper.SystemConfigureMapper;
import com.attendance.www.hr.dao.mapper.UserMapper;
import com.attendance.www.hr.entitys.EmployeeRole;
import com.attendance.www.hr.entitys.EmployeeRoleExample;
import com.attendance.www.hr.entitys.SystemConfigure;
import com.attendance.www.hr.entitys.SystemConfigureExample;
import com.attendance.www.hr.entitys.User;
import com.attendance.www.hr.entitys.UserExample;
import com.attendance.www.hr.exception.ResultFaultException;
import com.attendance.www.hr.service.ICommonService;
import com.attendance.www.hr.service.IReportService;
import com.attendance.www.hr.utils.FactorialUtils;

@Service
public class ReportServiceImpl implements IReportService {
	@Resource
	private ReportAttendanceExtMapper reportExtDao;
	@Resource
	private EmployeeMapper employeeDao;
	@Resource
	private EmployeeExtMapper employeeExtDao;
	@Resource
	private SystemConfigureMapper systemConfigureDao;
	@Resource
	private ICommonService commonService;
	@Resource
	private EmployeeCorporationMapper employeeCorporationDao;
	@Resource
	private CorporationMapper corporationDao;
	@Resource
	private EmployeeDepartmentMapper employeeDepartmentDao;
	@Resource
	private DepartmentMapper departmentDao;
	@Resource
	private EmployeeRoleMapper employeeRoleDao;
	@Resource
	private EmployeeRoleExtMapper employeeRoleExtDao;
	@Resource
	private RoleMapper roleDao;
	@Resource
	private PrivilegeGroupMapper privilegeGroupDao;
	@Resource
	private UserMapper userDao;
	@Resource
	private CorporationExtMapper corporationExtDao;
	

	/**
	 * 根据权限查报表，验证
	 */
	@Override
	public ReportAttendanceParam getReportByAuthority(ReportAttendanceParam paramBean, Integer employeeId) {
		UserExample userExample=new UserExample();
		userExample.createCriteria().andEmployeeIdEqualTo(employeeId);
		List<User> userList=userDao.selectByExample(userExample);
		Integer privilegeGroupId=0;
		if (userList.size()>0) {
			privilegeGroupId=userList.get(0).getPrivilegeGroupId();
			if (privilegeGroupId==0 || privilegeGroupId==null) {
				throw new ResultFaultException("0_00031");
			}
		}
		
		//公司codeMap
		Map<String, String> corCodeMap = new HashMap<>();
		//先查出该人的所有分配公司
		CorporationBean corporationBean = new  CorporationBean();
		corporationBean.setEmployeeId(employeeId);
		corporationBean.setFromDate(new Date());
		List<CorporationBean> corCodeList = corporationExtDao.getCorporationPermitList(corporationBean);
		//已分配的公司code集合list
		List<String> hasCorCodeList = new ArrayList<>();
		for (CorporationBean corporationBean2 : corCodeList) {
			corCodeMap.put(corporationBean2.getCorporationCode(), corporationBean2.getCorporationCode());
			hasCorCodeList.add(corporationBean2.getCorporationCode());
		}
		if (privilegeGroupId==4) {
			if (corCodeMap.size()>0) {
				//最终查询条件公司code集合 
				List<String> corporationList=new ArrayList<>();
				//传参的公司code集合
				List<String> corporationCodeListRe=paramBean.getCorporationList();
				if (corporationCodeListRe.size()>0) {
					for (String corCode : corporationCodeListRe) {
						if (corCodeMap.containsKey(corCode)) {
							corporationList.add(corCode);
						}
					}
					if (corporationList.size()==0) {
						paramBean.setCorporationId(-1);
					}
				} else {//参数为空的情况
					corporationList = hasCorCodeList;
				}
				paramBean.setCorporationList(corporationList);
			} else {//此人，没有分配公司的情况
				paramBean.setCorporationId(-1);
			}
		} else if (privilegeGroupId==5){
			if (corCodeMap.size()>0) {
				//最终查询条件公司code集合 
				List<String> corporationList=new ArrayList<>();
				//传参的公司code集合
				List<String> corporationCodeListRe=paramBean.getCorporationList();
				if (corporationCodeListRe.size()>0) {
					for (String corCode : corporationCodeListRe) {
						if (corCodeMap.containsKey(corCode)) {
							corporationList.add(corCode);
						}
					}
					if (corporationList.size()==0) {
						paramBean.setCorporationId(-1);
					}
				} else {//参数为空的情况
					corporationList = hasCorCodeList;
				}
				paramBean.setCorporationList(corporationList);
			} else {//此人，没有分配公司的情况
				paramBean.setCorporationId(-1);
			}
			
			/**************************原查询方式******************************/
			/*EmployeeCorporationExample employeeCorporationExample=new EmployeeCorporationExample();
			//分配的公司集合
			employeeCorporationExample.or().andEmployeeIdEqualTo(employeeId)
			.andFromDateLessThanOrEqualTo(new Date())
			.andThruDateGreaterThanOrEqualTo(new Date())
			.andIsCorporationEqualTo(1);
			
			employeeCorporationExample.or().andEmployeeIdEqualTo(employeeId)
			.andFromDateLessThanOrEqualTo(new Date())
			.andThruDateIsNull()
			.andIsCorporationEqualTo(1);
			List<EmployeeCorporation> ecList=employeeCorporationDao.selectByExample(employeeCorporationExample);*/
			
			//默认的公司集合
			/*EmployeeCorporationExample employeeCorporationExample2=new EmployeeCorporationExample();
			employeeCorporationExample2.or().andEmployeeIdEqualTo(employeeId)
			.andFromDateLessThanOrEqualTo(new Date())
			.andThruDateGreaterThanOrEqualTo(new Date())
			.andIsCorporationEqualTo(0);
			employeeCorporationExample2.or().andEmployeeIdEqualTo(employeeId)
			.andFromDateLessThanOrEqualTo(new Date())
			.andThruDateIsNull()
			.andIsCorporationEqualTo(0);
			List<EmployeeCorporation> ecDefaultList=employeeCorporationDao.selectByExample(employeeCorporationExample2);*/
			//Corporation defaultCorporation=corporationDao.selectByPrimaryKey(ecDefaultList.get(0).getCorporationId());
			/*if (ecList.size()>0) {
				//公司code集合 
				List<String> corporationList=new ArrayList<>();
				
				//判断有没有传自己默认公司
				boolean isCorporation=false;
				//公司code集合 
				List<String> corporationList=new ArrayList<>();
				//传参的公司code集合
				List<String> corporationCodeListRe=paramBean.getCorporationList();
				for (EmployeeCorporation employeeCorporation : ecList) {
					Integer corporationId=employeeCorporation.getCorporationId();
					Corporation corporation=corporationDao.selectByPrimaryKey(corporationId);
					if (corporationCodeListRe.size()>0) {
						for (String corporationCode : corporationCodeListRe) {
							if (corporationCode.equals(corporation.getCorporationCode())) {
								corporationList.add(corporation.getCorporationCode());
							}
							//判断有没有传自己默认公司
							if (defaultCorporation.getCorporationCode().equals(corporationCode)) {
								isCorporation=true;
							}
						}
						if (corporationList.size()==0 && !isCorporation) {
							paramBean.setCorporationId(-1);
						} else {//有匹配的公司，将这个id置null
							paramBean.setCorporationId(null);
						}
					} else {//参数为空的情况
						corporationList.add(corporation.getCorporationCode());
					}
				}
				//没传参数时
				if (corporationCodeListRe.size()==0 || isCorporation) {
					//不是HR人员就根据rolepath查看
					EmployeeRoleExample erExample=new EmployeeRoleExample();
					erExample.or().andEmployeeIdEqualTo(employeeId)
					.andFromDateLessThanOrEqualTo(new Date())
					.andThruDateGreaterThanOrEqualTo(new Date());
					erExample.or().andEmployeeIdEqualTo(employeeId)
					.andFromDateLessThanOrEqualTo(new Date())
					.andThruDateIsNull();
					//人员所属的岗位关系集合
					List<EmployeeRole> erList=employeeRoleDao.selectByExample(erExample);
					if (erList.size()>0) {
						//岗位path集合 
						List<String> rolePathList=new ArrayList<>();
						for (EmployeeRole employeeRole : erList) {
							Integer roleId=employeeRole.getRoleId();
							Role role=roleDao.selectByPrimaryKey(roleId);
							rolePathList.add(role.getRolePath());
						}
						paramBean.setRolePathList(rolePathList);
					}
				}
				paramBean.setCorporationList(corporationList);
			} else {//此人，没有分配公司的情况
				paramBean.setCorporationId(-1);
			}*/
		} else {
			List<Integer> employeeIdList=new ArrayList<Integer>();
			EmployeeRoleExample employeeRoleExample=new EmployeeRoleExample();
			employeeRoleExample.createCriteria().andEmployeeIdEqualTo(employeeId);
			List<EmployeeRole> employeeRoleList=employeeRoleDao.selectByExample(employeeRoleExample);
			for(int i=0;i<employeeRoleList.size();i++) {
				employeeIdList.addAll(employeeRoleExtDao.selectEmployeeRoleGetEmployeeIdByRoleId(employeeRoleList.get(i).getRoleId()));
			}
			employeeIdList=FactorialUtils.filterEmployeeId(employeeIdList);
			if(employeeIdList.size()<=0) {
				employeeIdList.add(-1);
			}
			paramBean.setEmployeeIdList(employeeIdList);
			
			/***************************原版本-根据岗位查找********************************/
			//不是HR人员就根据rolepath查看
			/*EmployeeRoleExample erExample=new EmployeeRoleExample();
			erExample.or().andEmployeeIdEqualTo(employeeId)
			.andFromDateLessThanOrEqualTo(new Date())
			.andThruDateGreaterThanOrEqualTo(new Date());
			
			erExample.or().andEmployeeIdEqualTo(employeeId)
			.andFromDateLessThanOrEqualTo(new Date())
			.andThruDateIsNull();
			//人员所属的岗位关系集合
			List<EmployeeRole> erList=employeeRoleDao.selectByExample(erExample);
			if (erList.size()>0) {
				//岗位path集合 
				List<String> rolePathList=new ArrayList<>();
				for (EmployeeRole employeeRole : erList) {
					Integer roleId=employeeRole.getRoleId();
					Role role=roleDao.selectByPrimaryKey(roleId);
					rolePathList.add(role.getRolePath());
				}
				paramBean.setRolePathList(rolePathList);
			}*/
			/************************************************************/		
			paramBean.setCorporationList(null);
		}
		return paramBean;
	}

	/**
	 * 翻页查询考勤报表基本信息
	 */
	@Override
	public List<ReportAttendanceBean> getReportAttendanceBaseInfoList(ReportAttendanceParam paramBean) {
		List<ReportAttendanceBean> beasBeanList = reportExtDao.getReportBaseInfoList(paramBean);
		return beasBeanList;
	}
	
	/**
	 * 求天数(或次数)map，代码块
	 */
	public Map<Integer, Integer> codeBlock(List<ReportAttendanceBean> list){
		Map<Integer, Integer> resultMap=new HashMap<>();
		for (ReportAttendanceBean reportAttendanceBean : list) {
			resultMap.put(reportAttendanceBean.getKey(), reportAttendanceBean.getAttdays());
		}
		return resultMap;
	}

	/**
	 * 实际是：应出勤天数
	 */
	@Override
	public Map<Integer, Integer> getRealAttendanceDays(
			ReportAttendanceParam paramBean, List<Integer> employeeIds) {
		List<ReportAttendanceBean> list=reportExtDao.getRealAttendanceDays(paramBean, employeeIds);
		
		return codeBlock(list);
	}

	/**
	 * 取得员工迟到次数
	 */
	@Override
	public Map<Integer, Integer> getLateCount(ReportAttendanceParam paramBean,
			List<Integer> employeeIds) {
		List<ReportAttendanceBean> list=reportExtDao.getLateCount(paramBean, employeeIds);
		return codeBlock(list); 
	}

	/**
	 * 早退次数
	 */
	@Override
	public Map<Integer, Integer> getLeaveEarlyCount(
			ReportAttendanceParam paramBean, List<Integer> employeeIds) {
		List<ReportAttendanceBean> list=reportExtDao.getLeaveEarlyCount(paramBean, employeeIds);
		return codeBlock(list);
	}

	/**
	 * 旷工次数
	 */
	@Override
	public Map<Integer, Integer> getAbsentCount(
			ReportAttendanceParam paramBean, List<Integer> employeeIds) {
		List<ReportAttendanceBean> list=reportExtDao.getAbsentCount(paramBean, employeeIds);
		return codeBlock(list);
	}
	
	/**
	 * 补签次数
	 */
	@Override
	public Map<Integer, Integer> getRetroactiveCount(
			ReportAttendanceParam paramBean, List<Integer> employeeIds) {
		List<ReportAttendanceBean> list=reportExtDao.getRetroactiveCount(paramBean, employeeIds);
		return codeBlock(list);
	}
	
	/**
	 * 求分钟数map，代码块----分钟转化成天
	 */
	public Map<Integer, Float> codeBlockHours(List<ReportAttendanceBean> list){
		Map<Integer, Float> resultMap=new HashMap<>();
		for (ReportAttendanceBean reportAttendanceBean : list) {
			Float hours = reportAttendanceBean.getHours();
			if (hours==null) {
				hours=0f;
			}
			Float value = (float)(Math.round((hours/60/8)*100))/100;
			resultMap.put(reportAttendanceBean.getKey(), value);
		}
		return resultMap;
	}
	

	/**
	 * 取得员工平日加班天数
	 */
	@Override
	public Map<Integer, Float> getOvertimeNomal(
			ReportAttendanceParam paramBean, List<Integer> employeeIds) {
		List<ReportAttendanceBean> list=reportExtDao.getOvertimeNomal(paramBean, employeeIds);
		return codeBlockHours(list);
	}

	/**
	 * 取得员工双休日加班天数
	 */
	@Override
	public Map<Integer, Float> getOvertimeWeekend(
			ReportAttendanceParam paramBean, List<Integer> employeeIds) {
		List<ReportAttendanceBean> list= reportExtDao.getOvertimeWeekend(paramBean, employeeIds);
		return codeBlockHours(list);
	}

	/**
	 * 取得员工节假日加班天数
	 */
	@Override
	public Map<Integer, Float> getOvertimeHoliday(
			ReportAttendanceParam paramBean, List<Integer> employeeIds) {
		List<ReportAttendanceBean> list= reportExtDao.getOvertimeHoliday(paramBean, employeeIds);
		return codeBlockHours(list);
	}

	/**
	 * 取得员工请年假天数
	 */
	@Override
	public Map<Integer, Float> getRestYearUsed(ReportAttendanceParam paramBean,
			List<Integer> employeeIds) {
		List<ReportAttendanceBean> list= reportExtDao.getRestYearUsed(paramBean, employeeIds);
		return codeBlockHours(list);
	}

	/**
	 * 请假调休天数
	 */
	@Override
	public Map<Integer, Float> getRestTuneUsed(ReportAttendanceParam paramBean,
			List<Integer> employeeIds) {
		List<ReportAttendanceBean> list= reportExtDao.getRestTuneUsed(paramBean, employeeIds);
		return codeBlockHours(list);
	}

	/**
	 * 取得员工请病假天数
	 */
	@Override
	public Map<Integer, Float> getRestIllUsed(ReportAttendanceParam paramBean,
			List<Integer> employeeIds) {
		List<ReportAttendanceBean> list= reportExtDao.getRestIllUsed(paramBean, employeeIds);
		return codeBlockHours(list);
	}

	/**
	 * 取得员工请事假天数 
	 */
	@Override
	public Map<Integer, Float> getRestThingUsed(
			ReportAttendanceParam paramBean, List<Integer> employeeIds) {
		List<ReportAttendanceBean> list= reportExtDao.getRestThingUsed(paramBean, employeeIds);
		return codeBlockHours(list);
	}

	/**
	 * 请产检假天数
	 */
	@Override
	public Map<Integer, Float> getRestCheckUsed(
			ReportAttendanceParam paramBean, List<Integer> employeeIds) {
		List<ReportAttendanceBean> list= reportExtDao.getRestCheckUsed(paramBean, employeeIds);
		return codeBlockHours(list);
	}

	/**
	 * 员工请产假天数(按筛选日期统计)
	 */
	@Override
	public Map<Integer, Integer> getRestBornUsed(ReportAttendanceParam paramBean,
			List<Integer> employeeIds) {
		List<ReportAttendanceBean> list= reportExtDao.getRestBornUsed(paramBean, employeeIds);
		return codeBlock(list);
	}

	/**
	 * 员工请哺乳假天数
	 */
	@Override
	public Map<Integer, Float> getRestSuckleUsed(
			ReportAttendanceParam paramBean, List<Integer> employeeIds) {
		List<ReportAttendanceBean> list= reportExtDao.getRestSuckleUsed(paramBean, employeeIds);
		return codeBlockHours(list);
	}

	/**
	 * 员工请婚假天数
	 */
	@Override
	public Map<Integer, Integer> getRestMarryUsed(
			ReportAttendanceParam paramBean, List<Integer> employeeIds) {
		List<ReportAttendanceBean> list= reportExtDao.getRestMarryUsed(paramBean, employeeIds);
		return codeBlock(list);
	}

	/**
	 * 员工请丧假天数
	 */
	@Override
	public Map<Integer, Integer> getRestDieUsed(ReportAttendanceParam paramBean,
			List<Integer> employeeIds) {
		List<ReportAttendanceBean> list= reportExtDao.getRestDieUsed(paramBean, employeeIds);
		return codeBlock(list);
	}

	/**
	 * 员工请陪产假天数
	 */
	@Override
	public Map<Integer, Integer> getRestBornAttendUsed(
			ReportAttendanceParam paramBean, List<Integer> employeeIds) {
		List<ReportAttendanceBean> list= reportExtDao.getRestBornAttendUsed(paramBean, employeeIds);
		return codeBlock(list);
	}

	/**
	 *  年假开始日期
	 */
	@Override
	public Map<Integer, Date> getYearRestYearBegin(
			ReportAttendanceParam paramBean, List<Integer> employeeIds) {
		List<ReportAttendanceBean> list= reportExtDao.getYearRestYearBegin(paramBean, employeeIds);
		Map<Integer, Date> resultMap=new HashMap<>();
		for (ReportAttendanceBean reportAttendanceBean : list) {
			resultMap.put(reportAttendanceBean.getKey(), reportAttendanceBean.getYearRestYearBegin());
		}
		return resultMap;
	}

	/**
	 *  可享受年假
	 */
	@Override
	public Map<Integer, Float> getYearRestYearAll(
			ReportAttendanceParam paramBean, List<Integer> employeeIds) {
		//获取系统配置表list，取得各年限年假天数
		List<SystemConfigure> sysList=systemConfigureDao.selectByExample(new SystemConfigureExample());
		if (sysList.size()==0 || sysList==null) {
			throw new ResultFaultException("0_00030");
		}
		SystemConfigure systemConfigure=sysList.get(0);
		Integer fiveYear=systemConfigure.getAnnualLeaveFive();
		Integer tenYear=systemConfigure.getAnnualLeaveTen();
		Integer fifteenYear=systemConfigure.getAnnualLeaveFifteen();
		//获取人员信息集合
		List<ReportAttendanceBean> list = reportExtDao.getYearRestYearAll(paramBean, employeeIds);
		Integer employeeId=null;
		Map<Integer, Float> map=new HashMap<>();
		Date thruDate = paramBean.getEndDate();
		//查询时间的结束时间
		Calendar calendarEnd = Calendar.getInstance();
		calendarEnd.setTime(thruDate);
		calendarEnd.set(Calendar.MONTH, 0);
		calendarEnd.set(Calendar.DAY_OF_MONTH,1);
		calendarEnd.set(Calendar.HOUR_OF_DAY,0);
		calendarEnd.set(Calendar.MINUTE,0);
		calendarEnd.set(Calendar.SECOND,0);
		calendarEnd.set(Calendar.MILLISECOND,0);
		calendarEnd.add(Calendar.YEAR, 1);
		calendarEnd.add(Calendar.MILLISECOND, -1);
		//循环计算每个人的年假时间
		for (ReportAttendanceBean reportAttendanceBean : list) {
			Date firstDate=reportAttendanceBean.getFirstDate();
			Date entryDate=reportAttendanceBean.getEntryDate();
			employeeId=reportAttendanceBean.getKey();//就是人员的ID
			//计算工作年数
			Float years = ((float)(calendarEnd.getTime().getTime()-firstDate.getTime()))/1000/3600/24/365;
			//入职本公司年数
			Float yearsEntry = ((float)(calendarEnd.getTime().getTime()-entryDate.getTime()))/1000/3600/24/365;
			//可休年假天数
			Float yearRestYear=0f;
			if (years<=1f) {
				yearRestYear=0f;
			}
			if (years>1f) {
				if(years>=1&&years<=10) {//1到10年
					yearRestYear=fiveYear * 1f;
				} else if(years>10&&years<11){//10年到11年
					yearRestYear = (years-10) * tenYear + (11-years) * fiveYear;
				} else if(years>=11&&years<=20){//11年到20年
					yearRestYear = tenYear * 1f;
				} else if(years>20&&years<21){//20年到21年
					yearRestYear = (years-20) * fifteenYear + (21-years) * tenYear;
				} else if(years>=21){//21年以上
					yearRestYear = fifteenYear * 1f;
				}
				//如果入职不满一年，乘以入职年数的百分数
				if (yearsEntry<1f) {
					yearRestYear=yearRestYear * yearsEntry;
				}
				yearRestYear=(float)(Math.round(yearRestYear*100))/100;
			}
			map.put(employeeId, yearRestYear);
		}
		return map;
	}

	/**
	 *  剩余调休假
	 */
	@Override
	public Map<Integer, Float> getYearRestTuneRemain(ReportAttendanceParam paramBean, List<Integer> employeeIds) {
		List<ReportAttendanceBean> list= reportExtDao.getYearRestTuneRemain(paramBean, employeeIds);
		return codeBlockHours(list);
	}

	/**
	 *  可休产假
	 */
	@Override
	public Map<Integer, Integer> getYearRestBornHave(ReportAttendanceParam paramBean, List<Integer> employeeIds) {
		List<ReportAttendanceBean> list= reportExtDao.getYearRestBornHave(paramBean, employeeIds);
		return codeBlock(list);
	}

	/**
	 * 已休产假天数(年初到筛选日期endDate)
	 */
	@Override
	public Map<Integer, Integer> getYearRestBornUsed(ReportAttendanceParam paramBean, List<Integer> employeeIds) {
		Date beginDate=paramBean.getBeginDate();
		//查询时间的开始，结束时间
		Calendar calendarEnd = Calendar.getInstance();
		calendarEnd.setTime(beginDate);
		calendarEnd.set(Calendar.MONTH, 0);
		calendarEnd.set(Calendar.DAY_OF_MONTH,1);
		calendarEnd.set(Calendar.HOUR_OF_DAY,0);
		calendarEnd.set(Calendar.MINUTE,0);
		calendarEnd.set(Calendar.SECOND,0);
		calendarEnd.set(Calendar.MILLISECOND,0);
		Date yearBeginDate=calendarEnd.getTime();
		paramBean.setBeginDate(yearBeginDate);
		List<ReportAttendanceBean> list= reportExtDao.getRestBornUsed(paramBean, employeeIds);
		return codeBlock(list);
	}
	
	/**
	 * 剩余产假天数(筛选日期endDate(不包含)到最后)
	 */
	@Override
	public Map<Integer, Integer> getYearRestBornRemain(ReportAttendanceParam paramBean, List<Integer> employeeIds) {
		Date endDate=paramBean.getEndDate();
		Date endDateAddOne=DateUtils.addDays(endDate, 1);
		paramBean.setBeginDate(endDateAddOne);
		paramBean.setEndDate(null);
		List<ReportAttendanceBean> list= reportExtDao.getRestBornUsed(paramBean, employeeIds);
		return codeBlock(list);
	}

}
